package com.icss.clothes.mapper;

import com.icss.clothes.entity.Type;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface TypeMapper {
    //查询所有商品类别
    @Select("select * from commodity_type")
    public List<Type> selectAll();
    //通过指定的商品编号查询得到所有商品类型
    @Select("select t.* from commodity_type t left outer join commodity c on t.type_id=c.type_id " +
            "where t.type_id=c.type_id and c.c_id=#{c_id}")
    public List<Type> selectAllTypeByC_id(int c_id);
}
